using UnityEditor;
using UnityEngine;
using System.Collections;
[CustomPropertyDrawer(typeof(BigIntVector))]

public class BigIntVectorDrawer : PropertyDrawer {
	
	public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
	{
		return 80;
	}
	public override void  OnGUI(Rect position,SerializedProperty property ,GUIContent label )
	{
		
		EditorGUI.PrefixLabel (position, GUIUtility.GetControlID(FocusType.Passive),label);
		
		position.y += 20;
		//position.x;
		EditorGUI.BeginProperty (position, label, property);
		
		// Don't make child fields be indented
		int indent = EditorGUI.indentLevel;
		EditorGUI.indentLevel = 3;

		// Calculate rects
		Rect x_pos = new Rect (position.x-20, position.y, 100, 20);
		Rect y_pos = new Rect (position.x-20, position.y+20, 100, 20);
		Rect z_pos = new Rect (position.x-20, position.y+40, 100, 20);

		// Draw fields - passs GUIContent.none to each so they are drawn without labels
		EditorGUI.LabelField(x_pos,"X:");
		EditorGUI.LabelField(y_pos,"Y:");
		EditorGUI.LabelField(z_pos,"Z:");
		x_pos = new Rect (position.x, position.y, 2000, 20);
		y_pos = new Rect (position.x, position.y+20, 2000, 20);
		z_pos = new Rect (position.x, position.y+40, 2000, 20);
		EditorGUI.PropertyField (x_pos, property.FindPropertyRelative ("x"), GUIContent.none);
		EditorGUI.PropertyField (y_pos, property.FindPropertyRelative ("y"), GUIContent.none);
		EditorGUI.PropertyField (z_pos, property.FindPropertyRelative ("z"), GUIContent.none);

		// Set indent back to what it was
		EditorGUI.indentLevel = indent;
		
		EditorGUI.EndProperty ();
		
		
	}
}
 